/*
 * Renderer.h
 *
 *  Created on: Sep 4, 2011
 *      Author: Patrick
 */

#ifndef RENDERER_H_
#define RENDERER_H_

#include "MediaCenter.h"
#include "Text.h"

#define MCR_STATE_STOPPED 0
#define MCR_STATE_STARTING 1
#define MCR_STATE_RUNNING 2
#define MCR_STATE_STOPPING 3

struct RendererContext {

		int screenWidth;
		int screenHeight;
		int screenBPP;

		Uint32 sdlVideoFlags;
		GLuint videoSurfaceTexture;

		int *keyBuffer;
		int *activeKeys;
		int keyBufferIndex;

};

class Renderer {

	private:

		int state;
		SDL_Surface* sdlSurface;
		RendererContext context;

	public:

		Renderer();

		int initialize();
		int start(RendererContext context);
		int stop();
		int destroy();

		void captureEvents(SDL_Event* event);
		void processEvents();
		void process(double delta);
		void render();

		int getState() {
			return state;
		}

};

#endif /* RENDERER_H_ */
